package ee.ut.algorithmics.project;

import java.io.IOException;
import java.util.List;

public class SimJoinMain {

	public static void main(String[] args) {
		new SimJoinMain().run();
	}

	public void run() {
		SimilarityJoin simJoin = new SimilarityJoin();
		Record first = null;
		Record second = null;
		try {
			first = ReadDocument.readDoc("text1.txt");
			second = ReadDocument.readDoc("text2.txt");
		} catch (IOException e) {
			e.printStackTrace();
		}
		Record[] documents = new Record[] { first, second };
		List<Record[]> simRecords = simJoin.allPairsSimilarityJoin(documents,
				0.6);
		int cnt = 1;
		for (Record[] records : simRecords) {
			for (Record record : records) {
				System.out.print(cnt + ". ");
				for (int i = 0; i < record.getRecordSize(); i++) {
					System.out.print(record.getToken(i) + " ");
				}
				cnt++;
			}
		}
	}
}
